/**
 * 将字符串类型的元素转换为字符串字面量类型
 * L extends `${infer LL}` 是为了限制数组内的元素为字符串，不能为bigint|number|boolean, 否则bigint会报错：Type 'L' is not assignable to type 'bigint'
 */
// type TupleToString<T, Prev extends string = ''> = T extends [infer L, ...infer R] ? TupleToString<R, `${Prev}${L}`> : Prev  有报错提示
export type TupleToString<T, Prev extends string = ''> = T extends [infer L, ...infer R] ? (L extends `${infer LL}` ? TupleToString<R, `${Prev}${L}`> : '') : Prev
type A = TupleToString<['a', 'b', 'c']> // 'abc'
type B = TupleToString<[]>              // ''
type C = TupleToString<['a']>           // 'a'
type D = TupleToString<[1123]>       // ''
type E = TupleToString<[true]>       // ''
